﻿<!--
    Copyright (C) 2011 Ari Rokosa, Chinedu Eze, Johannes Virtanen,
                       Petri Tuononen, Timo Korkalainen

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
@{Layout = null;}
<script type="text/javascript">
    $('#dialog-background').show();
</script>

<div id="dialog-small" class="dialog">
    <div class="close-dialog button-small" onclick="$('.dialog').remove(); $('#dialog-background').hide();"></div>
    <h2>Add items</h2>

    <script type="text/javascript">
        id = 0;
        var uploader = new qq.FileUploader({
            element: $('#file-uploader')[0],
            params: { id: id },
            action: '/Desktop/Upload/',
            allowedExtensions: [],
            onSubmit: function (id, fileName) {
                $('.qq-upload-list').hide();
            },
            onProgress: function (fileName, loaded, total) {
                $('.qq-upload-list').show();
            },
            onComplete: function (id, filename, data) {
                $('.qq-upload-list').hide();
                $.each(data, function (key, value) {
                    $(".dialog").remove();
                    $('#dialog-background').hide();
                    id++;
                });
            }
        });
    </script>

    <div id="file-uploader" class="text-button">Upload</div>
    <div class="qq-upload-list"></div>
</div>